﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="ViewCharts.aspx.vb" Inherits="TeachersWorkSheets.ViewCharts" %>
<%@ Register assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI.DataVisualization.Charting" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style5
        {
            color: #000000;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p>
    <br />
        <table style="width:100%;">
            <tr>
                <td class="style5">
                    Top Ten Likes</td>
                <td class="style5">
                    <strong>top ten Rating</strong></td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td align="center">
    <asp:Chart ID="Chart1" runat="server" DataSourceID="SqlDataSource1">
        <series>
            <asp:Series Name="Series1" XValueMember="ShtName" YValueMembers="counter">
            </asp:Series>
        </series>
        <chartareas>
            <asp:ChartArea Name="ChartArea1">
            </asp:ChartArea>
        </chartareas>
    </asp:Chart>
                </td>
                <td>
    <asp:Chart ID="Chart2" runat="server" DataSourceID="SqlDataSource2">
        <series>
            <asp:Series Name="Series1" XValueMember="ShtName" YValueMembers="mycounter">
            </asp:Series>
        </series>
        <chartareas>
            <asp:ChartArea Name="ChartArea1">
            </asp:ChartArea>
        </chartareas>
    </asp:Chart>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
</p>
    <p>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:SheetsConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:SheetsConnectionString.ProviderName %>" 
            SelectCommand="SELECT  top 10 ActivitySheet.ShtName, format(avg(UserSheetRating.Rating),'0') AS mycounter FROM (ActivitySheet INNER JOIN UserSheetRating ON ActivitySheet.ID = UserSheetRating.SheetID) GROUP BY ActivitySheet.ShtName">
        </asp:SqlDataSource>
</p>
    <p>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:SheetsConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:SheetsConnectionString.ProviderName %>" 
            SelectCommand="SELECT top 10  COUNT(usersheetLiking.sheetid) AS [counter], ActivitySheet.ShtName FROM (usersheetLiking INNER JOIN ActivitySheet ON usersheetLiking.sheetid = ActivitySheet.ID) GROUP BY ActivitySheet.ShtName">
        </asp:SqlDataSource>
</p>
<p>
</p>
</asp:Content>
